package org.vpm.mediaplayer;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import android.app.ExpandableListActivity;
import android.os.Bundle;
import android.widget.ExpandableListAdapter;
import android.widget.SimpleExpandableListAdapter;

public class SpeakerActivity extends ExpandableListActivity {
private static final String NAME = "NAME";
	
	private ExpandableListAdapter mAdapter;
	
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		List<Map<String, String>> groupData = new ArrayList<Map<String, String>>(); 
		List<List<Map<String, String>>> childData = new ArrayList<List<Map<String, String>>>(); 
		 
		Map<String, String> curGroupMap;
		List<Map<String, String>> children;
		Map<String, String> curChildMap;
		
		// Group 1
		curGroupMap = new HashMap<String, String>(); 
	    groupData.add(curGroupMap); 
	    curGroupMap.put(NAME, "5 Things God Uses To Grow Your Faith");
	    
	    // Group 2
	    curGroupMap = new HashMap<String, String>(); 
	    groupData.add(curGroupMap);
	    curGroupMap.put(NAME, "C2 Commitment Celebration");
	    
	    // Group 1 values
		children = new ArrayList<Map<String, String>>(); 
		curChildMap = new HashMap<String, String>(); 
		children.add(curChildMap); 
		curChildMap.put(NAME, "2G2BT"); 
		
		curChildMap = new HashMap<String, String>(); 
		children.add(curChildMap); 
		curChildMap.put(NAME, "Ding!");
		
		curChildMap = new HashMap<String, String>(); 
		children.add(curChildMap); 
		curChildMap.put(NAME, "Pivotal Circumstances"); 
		
		curChildMap = new HashMap<String, String>(); 
		children.add(curChildMap); 
		curChildMap.put(NAME, "Personal Ministry"); 
		childData.add(children);
		
		// Group 2 values
		children = new ArrayList<Map<String, String>>(); 
		curChildMap = new HashMap<String, String>(); 
		children.add(curChildMap); 
		curChildMap.put(NAME, "Private Disciplines"); 
		
		curChildMap = new HashMap<String, String>(); 
		children.add(curChildMap); 
		curChildMap.put(NAME, "Providential Relationships");
		
		curChildMap = new HashMap<String, String>(); 
		children.add(curChildMap); 
		curChildMap.put(NAME, "Practical Teaching"); 
		
		curChildMap = new HashMap<String, String>(); 
		children.add(curChildMap); 
		curChildMap.put(NAME, "Big Faith");
		
		curChildMap = new HashMap<String, String>(); 
		children.add(curChildMap); 
		curChildMap.put(NAME, "C2 Commitment Celebration"); 
		childData.add(children);
		
		mAdapter = new SimpleExpandableListAdapter(this, groupData, 
				R.layout.group_layout, new String[] {NAME}, new int[] {R.id.groupname},
				childData, R.layout.child_layout, new String[] {NAME}, new int[] {R.id.childname});
		setListAdapter(mAdapter);
	}
}
